<template>
	<view class="page">
		<view class="title f_48 f_normal">教学经历</view>
			<view class="experience-list-box">
				<view v-for="(item,index) in experienceList" :key="index" class=" item" @click="skipDetail(index)">
					<view class="dis-flex flex-x-between">
						<view class="f_28 navy_blue m_r_32 name">
							{{item.corporation}}
						</view>
						<view class="f_22 time">
							{{item.starttime}}<text v-if="item.endtime!=''">-{{item.endtime}}</text>
						</view>
					</view>
					<view class="f_24 gery1">{{item.title}}</view>
					<view class="f_24 gery1 describe">{{item.content}}</view>
				</view>
			</view>
			<load-more @tap.stop="bindLoading" :status="loadingStatus"></load-more>
	</view>
</template>

<script>
import API from '@/static/api/index.js';
import loadMore from '@/components/loadmore/index.vue';
const app = getApp();
export default{
	name:'index',
	components:{
		loadMore
	},
	onLoad(options) {
		this._getExperience(options.teacher_id)
	},
	methods:{
		_getExperience(id){
			let that = this
			API.getExperience(id).then(res=>{
				if(res.data.experience.length>0){
					that.experienceList=res.data.experience
					that.loadingStatus="nomore"
				}else{
					that.loadingStatus="empty"
				}
			})
		},
		skipDetail(index){
			app._log("第"+(index+1))
		},
		// 点击加载
		bindLoading(){
			if(this.loadingStatus=='error'||this.loadingStatus=='empty'){
				this.page_index=1;
				this.getAddressByAddress();
			}
		},
	},
	data(){
		return{
			loadingStatus:'loading',
			experienceList:[]
		}
	},
}
</script>

<style scoped lang="scss">
.page{
	padding-bottom: 100rpx;
	background-color: white;
	.title{
		color: #252748;
		padding: 28rpx 48rpx;
		border-bottom: 16rpx solid #f4f4f4;;
	}
	.experience-list-box{
		padding: 0 48rpx;
		.item{
			padding-top: 48rpx;
			image{
				width: 228rpx;
				height: 152rpx;
			}
			.name{
				text-align: justify;
				margin-bottom: 16rpx;
			}
			.time{
				color: rgba(143, 143, 154, 0.6);
			}
		}
	}
	.describe{
		margin-top: 18rpx;
		text-align: justify;
	}
}
</style>
